package com.houhanzhi.service;

import com.houhanzhi.controller.request.TrafficPageRequest;
import com.houhanzhi.controller.request.UseTrafficRequest;
import com.houhanzhi.model.EventMessage;
import com.houhanzhi.response.JsonData;
import com.houhanzhi.vo.TrafficVO;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author houhanzhi
 * @since 2025-01-02
 */
public interface TrafficService  {

    /**
     * 处理流量包事件消息
     * @param eventMessage
     */
    void handleTrafficMessage(EventMessage eventMessage);

    /**
     * 分页查询可用流量包
     * @param request
     * @return
     */
    JsonData pageOfAvailableTraffic(TrafficPageRequest request);

    /**
     * 流量包详情
     *
     * @return
     */
    TrafficVO detail(Long trafficId);

    /**
     *
     *  扣减流量包API
     * @param useTrafficRequest
     * @return
     */
    JsonData reduce(UseTrafficRequest useTrafficRequest);

    /**
     * 删除过期流量包
     */
    boolean deleteExpiredTraffic();
}
